import { createRouter, createWebHashHistory } from 'vue-router'
import MusicList from '../components/MusicList.vue';
import Carousel from '../components/Carousel.vue';
import PersonCenter from '../components/personCenter/PersonCenter.vue'
import UserMusic from '../components/UserMusic.vue'
import MyMusic from '../components/my/MyMusic.vue'
import MySinger from '../components/my/MySinger.vue'
import Friends from '../components/post/Friends.vue'
import MyMusicListEdit from '../components/my/MyMusicListEdit.vue'
import SingleMusic from '../components/SingleMusic.vue'
import EditPersonInfo from '../components/personCenter/EditPersonInfo.vue'
import Singer from '../components/Singer/Singer.vue'
import Search from '@components/search/Search.vue'
import MoreMusicList from '@components/index/MoreMusicList.vue'
import IndexPage from '@components/index/Index.vue'
import Upload from '@components/my/Upload.vue';
import MoreMusic from '@components/index/MoreMusic.vue';
import PostPage from '@components/post/PostPage.vue'
const router = createRouter({
    history: createWebHashHistory(), routes: [
        {
            name: 'index',
            path: '/',
            components: {
                IndexPage: IndexPage,
                Carousel: Carousel
            }
        },

        {
            name: 'singleMusic',
            path: '/music/:musicId',
            components: {
                SingleMusic: SingleMusic
            },
            props: {
                SingleMusic: true
            }
        },
        {
            name: 'moreMusicList',
            path: '/moreMusicList',
            components: {
                MoreMusicList: MoreMusicList
            }
        },
        {
            name: 'moreMusic',
            path: '/moreMusic',
            components: {
                MoreMusic: MoreMusic
            }
        },
        {
            name: 'musicList',
            path: '/musicList/:musicListId/:disableSlide',
            components: {
                MusicList: MusicList
            },
            props: {
                MusicList: true
            }
        },
        {
            name: 'personCenter',
            path: '/personCenter/:userId/:type',
            components: {
                PersonCenter: PersonCenter
            },
            props: {
                PersonCenter: true
            },
            children: [{
                name: 'editPersonInfo',
                path: 'editPersonInfo',
                components: {
                    EditPersonInfo: EditPersonInfo
                }
            }
            ]
        },
        {
            name: 'singer',
            path: '/singer/:id',
            components: {
                Singer: Singer
            },
            props: {
                Singer: true
            }
        },
        {
            name: 'myMusic',
            path: '/my',
            components: {
                UserMusic: UserMusic
            },
            children: [
                {
                    name: 'myMusic',
                    path: 'myMusic',
                    components: {
                        MyMusic: MyMusic
                    }
                },
                {
                    name: 'myMusicList',
                    path: 'myMusicList/:musicListId/:disableSlide',
                    props: {
                        MyMusicList: true
                    },
                    components: {
                        MyMusicList: MusicList
                    }
                },
                {
                    name: 'mySinger',
                    path: 'mySinger',
                    components: {
                        MySinger: MySinger
                    }
                },
                {
                    name: 'listEdit',
                    path: 'edit/:musicListId',
                    components: {
                        MyMusicListEdit: MyMusicListEdit
                    },
                    props: {
                        MyMusicListEdit: true
                    }
                },
                {
                    name: 'Upload',
                    path: 'Upload/:editType/:id',
                    components: {
                        Upload: Upload
                    },
                    props: {
                        Upload: true
                    }
                },
            ]
        },
        {
            name: 'Friends',
            path: '/post',
            components: {
                Friends: Friends
            }
        },
        {
            name: 'PostPage',
            path: '/postPage/:postId',
            components: {
                PostPage: PostPage
            },
            props: true
        },
        {
            name: 'Search',
            path: '/search/:kw?',
            components: {
                Search: Search
            },
            props: {
                Search: true
            }
        }
    ]
})
export default router